<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function sendAjax(){
            /**
             * 查询所有用户
             */ 
            // $.ajax({
            //     type: 'get',
            //     url: 'http://ums.tangxiaoyang.vip/api/user/findAll',
            //     dataType: 'json',
            //     success: function(res){
            //         console.log(res)
            //     }
            // })

            /**
             * 添加用户
             */
            $.ajax({
                type: 'post',
                url: 'http://ums.tangxiaoyang.vip/api/user/add',
                data: {
                    name: '汤小洋',
                    phone: '13888888888',
                    address: '南京'
                },
                dataType: 'json',
                success: function(res){
                    console.log(res)
                }
            })
        }
    </script>
</head>
<body>
    <button onclick="sendAjax()">发送Ajax请求</button>
</body>
</html>